-
Notifications
You must be signed in to change notification settings - Fork 321
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Audio: IGO_NR: Convert to module adapter #8301
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks clean.
9918c61
to
cd4e32a
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
that's a lot of rework!
cd4e32a
to
5d0fd84
Compare
5d0fd84
to
2af73d8
Compare
2af73d8
to
2a18630
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
that's definitely not one PR work, right? title is convert to module interface, inside PR, at least 3 tasks are done, do you want to split it to several PRs? for better review/merge/track?
The problem is that the component didn't work even with IPC3. It's impossible to test without all the changes included. Since this is a closed component and not useful without licensing it, I'd like to pass this with small effort to make this testable again. The owner or licensors of this should do the extra polishing effort. |
Ack - the aim here is not to change functionality or improve performance, but to do the mechanical work to bring it to the module API. Once at module API, it can then be integrated by folks who work on this module. |
2a18630
to
ffca82f
Compare
src/audio/igo_nr/igo_nr.c
Outdated
case SOF_IPC4_SWITCH_CONTROL_PARAM_ID: | ||
comp_info(dev, "igo_nr_cmd_set_config(), SOF_IPC4_SWITCH_CONTROL_PARAM_ID"); | ||
return igo_nr_set_chan(mod, ctl); | ||
return 0; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
redundant line
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yep!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oops, wasn't fixed. Done now.
src/audio/igo_nr/igo_nr.c
Outdated
ptr = (char *)ptr - cir_buf_size; | ||
|
||
return ptr; | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
static inline void *cir_buf_wrap(void *ptr, void *buf_addr, void *buf_end)
{
if (ptr >= buf_end)
ptr = (char *)buf_addr +
((char *)ptr - (char *)buf_end);
assert((intptr_t)ptr <= (intptr_t)buf_end);
return ptr;
}
why not directly use this?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't see issues in what I proposed.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
check https://github.com/thesofproject/sof/blob/main/src/include/sof/audio/audio_stream.h#L414
you don't need define a new one.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
OK, I've changed and tested it now - pushing new version!
@lyakh @btian1 we only need to focus review on the changes to use the module API. This PR is not about improving the existing IGO code as we need to minimize the change surface here to module API integration only. So yes, there are lots of ways the IGO code can be improved, but we need to get integration with module API done before any other code improvements. Same goes for all 3P modules integrations to module API. |
ffca82f
to
4b17596
Compare
I rebased and fixed rimage related conflicts. This version sounds choppy in playback test (sof-hda-benchmark-igo_nr32-tgl.tplg). |
Correction, the issue was in my test setup: DUT -> USB sound card -> PC. Hooking headphones directly to DUT fixed the choppy playback. Also I was able to fix the choppy sounding test setup afterwards. So, this version is OK. Also note for testing. Since there is no DP scheduler for TGL, I'm not able to process 768 frame size (16 ms), so I've made this code change (not in PR) just for my own DUT test run:
Need to address the DP rimage mode for MTL and example topology later. In TGL changing the period in topology to 16 ms has no impact since IPC4 assumes 1 ms for LL scheduling. |
4b17596
to
582836c
Compare
582836c
to
4150713
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, only one open left.
src/audio/igo_nr/igo_nr.c
Outdated
ptr = (char *)ptr - cir_buf_size; | ||
|
||
return ptr; | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
check https://github.com/thesofproject/sof/blob/main/src/include/sof/audio/audio_stream.h#L414
you don't need define a new one.
4150713
to
419e505
Compare
419e505
to
068240b
Compare
@singalsu conflicts, probably since RTNR merged. |
This patch converts this component to module adapter API. - New() becomes simpler init() - Params() is handled in module adapter, in init() "mod->verify_params_flags = BUFF_PARAMS_RATE;" replaces igo_nr_verify_params(). - Rates check in params() is placed to separate function igo_nr_check_params() to be called from prepare(). - cmd() handler is changed to module adapter client style with igo_nr_set_config() and igo_nr_get_config(). - igo_nr_process() and igo_nr_copy() are merged to module API style igo_nr_process() function. - igo_nr_prepare() sets source and sink align constraints for processing. - igo_nr_trigger() is removed, handled by module adapter. - Changes to support IPC4. Signed-off-by: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com>
Function igo_nr_init() expects a nonzero value for rballoc() size so this can't be left zero. The value is just something for stub usage that felt suitable for an unknown. Signed-off-by: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com>
This allows to build and load IGO NR stub version to testbench. Signed-off-by: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com>
The source sink API is needed for DP (data processing) scheduler that is needed for 16 ms schedule rate. Signed-off-by: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com>
This patch enables to load the component in the changed platforms. Signed-off-by: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com>
068240b
to
3685642
Compare
This is first "working" draft IPC4 version, but processing with stub library is forced to 48 frames for 1 ms LL scheduling. It obviously can't be used with the real processing library. For 16 ms need to change this further to support DP mode in IPC4.